package com.blog.Utils;

import org.springframework.stereotype.Component;

/**
 * @author 任浩
 * @version 1.0
 */

@Component
public class ThreadLocalUtil {
    private ThreadLocal threadLocal = new ThreadLocal();

    //为threadLocal设置值
    public void set(String vaild){
        threadLocal.set(vaild);
    }

    //得到threadlocal的值
    public String get(){
        return (String) threadLocal.get();
    }

    //删除threadLocal的值
    public void remove(){
        threadLocal.remove();
    }
}
